home *** CD-ROM | disk | FTP | other *** search
- Path: news.larc.nasa.gov!amiga-request
- From: amiga-request@ab20.larc.nasa.gov (Amiga Sources/Binaries Moderator)
- Subject: v91i121: MemMometer 2.20 - memory gauge, Part02/02
- Reply-To: hull@hao.ucar.edu (Howard Hull)
- Newsgroups: comp.sources.amiga
- Message-ID: <comp.sources.amiga.v91i121@ab20.larc.nasa.gov>
- References: <comp.sources.amiga.v91i120@ab20.larc.nasa.gov>
- Date: 14 Jun 91 22:30:41 GMT
- Approved: tadguy@uunet.UU.NET (Tad Guy)
- X-Mail-Submissions-To: amiga@uunet.uu.net
- X-Post-Discussions-To: comp.sys.amiga.misc
-
- Submitted-by: hull@hao.ucar.edu (Howard Hull)
- Posting-number: Volume 91, Issue 121
- Archive-name: utilities/memometer-2.20/part02
-
- #!/bin/sh
- # This is a shell archive. Remove anything before this line, then unpack
- # it by saving it into a file and typing "sh file". To overwrite existing
- # files, type "sh file -c". You can also feed this as standard input via
- # unshar, or by typing "sh <file", e.g.. If this archive is complete, you
- # will see the following message at the end:
- # "End of archive 2 (of 2)."
- # Contents: mm.c mminit.c
- # Wrapped by tadguy@ab20 on Fri Jun 14 18:30:39 1991
- PATH=/bin:/usr/bin:/usr/ucb ; export PATH
- if test -f 'mm.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'mm.c'\"
- else
- echo shar: Extracting \"'mm.c'\" \(38693 characters\)
- sed "s/^X//" >'mm.c' <<'END_OF_FILE'
- X/* : ai=0 bk=0 ts=8 */
- X#include "mm.h"
- X
- X#define FREEPEN -1L /* workbench screen default colors */
- X#define REQ_WINDOW_WIDTH 319L /* width of warning requester window */
- X#define REQ_WINDOW_HEIGHT 79L /* height of warning requester window */
- X
- X#define SOK 0x001f /* memory allocation control masks */
- X#define S1 0x0001
- X#define S2 0x0002
- X#define S4 0x0004
- X#define S8 0x0008
- X#define SA 0x0010
- X#define C1 0xfffe
- X#define C2 0xfffd
- X#define C4 0xfffb
- X#define C8 0xfff7
- X#define CA 0xffef
- X#define AARRRGH 20L /* hang 20, cats, we're startin ta curl! */
- X
- X#define EXTENSION 16L /* allocation request increment */
- X
- X#define FRAGS FALSE /* frags mode control boolian */
- X#define WARPS TRUE /* warps mode control boolian */
- X#define EVENMASK 0x7ffffffe /* used to prevent odd address traps */
- X#define CLIHEIGHT 200L /* window scaling stuff */
- X#define SIZEGAD 9L
- X#define DRAGBAR 10L
- X#define BORDER 2L
- X#define WINW 16L /* initial window width */
- X#define WINH (long)(CLIHEIGHT - SIZEGAD - DRAGBAR) /* initial win height */
- X#define MINH 81L /* shortest allowable window */
- X#define MAXH 576L /* longest allowable window */
- X#define BART 1L /* title bar F text location */
- X#define BARH (long)(WINH - SIZEGAD - DRAGBAR) /* bar height */
- X#define BARS (long)(BARH + 1) /* number of memory items to allocate */
- X#define BARB (long)(BARH + DRAGBAR - 1) /* bottom of mercury column */
- X#define BARE (long)(BARB + BORDER) /* bar end E text position */
- X#define BARW (long)(((WINW - (2 * BORDER)) / 3) - 1) /* 3 memfragmometers */
- X#define LEFT BORDER /* SLOW : since we're syncopated, we */
- X#define MIDDLE (LEFT + BARW + 1) /* SLOW-FAST : do it going from bar */
- X#define RIGHT (MIDDLE + BARW + 1) /* FAST :to bar at an irregular pace */
- X#define RTEXT - 4L /* offset for three char E/F text from left edge */
- X#define STARTVAL 64L /* start by getting enough storage for a few frags */
- X#define TMARK 100000L /* timer granule in microseconds */
- X#define TICKIES (long)(1000000/TMARK) /* number of TMARKS per second */
- X
- X/* typedef short BOOL */ /* this is in include/exec/types.h */
- X
- Xstruct IntuitionBase *IntuitionBase=NULL ;
- Xstruct Window *window ;
- Xstruct IntuiMessage *message;
- X/* struct IntuiMessage *GetMsg(); */ /* in functions.h */
- X
- Xstruct GfxBase *GfxBase=NULL ;
- X
- Xstruct IOStdReq *timermsg=NULL;
- Xstruct MsgPort *timerport=NULL;
- XULONG timerbit=NULL;
- X
- X
- Xextern void InitProjItems(); /* this stuff is in the mminit section */
- Xextern void InitSetupItems();
- Xextern void InitPrioItems();
- Xextern void InitChipItems();
- Xextern void InitChipAItems();
- Xextern void InitSFItems();
- Xextern void InitSFAItems();
- Xextern void InitFastItems();
- Xextern void InitFastAItems();
- Xextern void InitMenu();
- Xextern void StartMenus();
- X
- XBOOL p_mode = FRAGS; /* preset frags mode = 0, warps mode = 1 */
- X /* note: mode preset used as request for */
- X /* change to warps mode after the */
- X /* first pass with frags mode set! */
- Xlong p_rate = 2; /* preset sample interval, secs see menu */
- Xlong p_priority = 0; /* preset priority, range -128 to +127 */
- X /* note: pri greater than zero is risky! */
- X /* keep in mind AmigaDOS priorities: */
- X /* input.device 20, FileSystem 10, and */
- X /* trackdisk.device, CON: 5 also if MM */
- X /* is started from a CLI without the Run */
- X /* then that CLI inherits MM's priority! */
- Xlong p_chip = 512; /* preset chip mem size, kbytes see menu */
- Xlong p_chipa = 0; /* preset chip mem address, kb see menu */
- Xlong p_sf = 0; /* preset slowfast mem size, kb see menu */
- Xlong p_sfa = 2048; /* preset slowfast mem addr, kb see menu */
- Xlong p_fast = 0; /* preset fast mem size, mbytes see menu */
- Xlong p_fasta = -1; /* preset fast mem addr, mbytes see menu */
- X /* zero or neg fasta is offset below the */
- X /* A3000 fast ram ceiling, aka 0x7000000 */
- X
- Xstatic BOOL mode; /* uninitialized for mode control */
- Xstatic BOOL mmode; /* uninitialized for mode menu */
- Xstatic long delayval; /* uninitialized for delay menu */
- Xstatic long priority; /* uninitialized for priority menu */
- Xstatic long lastpri; /* uninitialized for priority incr */
- Xstatic long cmemsize; /* uninitialized for chip menu */
- Xstatic long cmembase; /* uninitialized for chipa menu */
- Xstatic long sfmemsize; /* uninitialized for sf menu */
- Xstatic long sfmembase; /* uninitialized for sfa menu */
- Xstatic long fmemsize; /* uninitialized for fast menu */
- Xstatic long fmembase; /* uninitialized for fasta menu */
- X
- Xstatic USHORT log ; /* memory allocation success flags */
- Xstatic BOOL things_are_cool = TRUE ; /* tells when to close the window */
- Xstatic BOOL intsig = FALSE ; /* intuition message detector */
- Xstatic USHORT chgflag = TRUE ; /* menu request to adjust columns */
- Xstatic long chip[3], fast[3] ; /* place to keep mem header pointers */
- Xstatic ULONG *chunkv ; /* demand allocated for frag chunks */
- Xstatic ULONG *sizev ; /* demand allocated for frag sizes */
- Xstatic ULONG *csum ; /* a col's height worth of checksums */
- Xstatic ULONG *oldcsum ; /* same height worth of old checksums */
- Xstatic USHORT *cell; /* 1 cell per pixel height of mercury */
- Xstatic long xl, xr ; /* used to Draw() memmometer segments */
- Xstatic long frags = STARTVAL ; /* # of demand allocated frag items */
- Xstatic long warps = BARS ; /* # of demand allocated column items */
- Xstatic long barh = BARH ; /* EVEN #'d height of mercury column */
- Xstatic long barb = BARB ; /* bottom position of mercury column */
- Xstatic short ticker = TICKIES ; /* initialized delay tick variable */
- X
- X/* struct RastPort *rp ; */ /* wonder why we don't need this... ? */
- X
- X
- Xstatic struct TextAttr myfont = {
- X (STRPTR) "topaz.font",
- X TOPAZ_EIGHTY,
- X 0,
- X 0
- X};
- X/* E newsize gadget refresh text */
- Xstatic char ebuf[4] = " E " ;
- Xstatic struct IntuiText e_text = {
- X BLUP, WHTP,
- X JAM2,
- X 0, BARE,
- X &myfont,
- X (UBYTE *)ebuf,
- X NULL
- X};
- X/* F title refresh text */
- Xstatic char fbuf[4] = " F " ;
- Xstatic struct IntuiText f_text = {
- X BLUP, WHTP,
- X JAM2,
- X 0, BART,
- X &myfont,
- X (UBYTE *)fbuf,
- X &e_text
- X};
- Xstatic struct NewWindow newwindow = {
- X 0, /* left edge */
- X 10, /* top edge */
- X WINW, /* width */
- X WINH, /* height */
- X 0, /* detail pen */
- X 1, /* block pen */
- X MENUPICK | NEWSIZE, /* messages */
- X/* WINDOWDEPTH | WINDOWCLOSE */ /* don't use these gads */
- X WINDOWDRAG | WINDOWSIZING | NOCAREREFRESH, /* add a few gadgets */
- X NULL, /* no custom gadgets */
- X NULL, /* default checkmark */
- X (UBYTE *)"F", /* title */
- X NULL, /* initialize this! */
- X NULL, /* use screen bitmap */
- X WINW, MINH, WINW, MAXH, /* min and max sizes */
- X WBENCHSCREEN } ; /* use workbench screen */
- X
- Xvoid initmenus()
- X{
- X (void) InitProjItems(); /* Initialize the menu items */
- X (void) InitSetupItems();
- X (void) InitPrioItems();
- X (void) InitChipItems();
- X (void) InitChipAItems();
- X (void) InitSFItems();
- X (void) InitSFAItems();
- X (void) InitFastItems();
- X (void) InitFastAItems();
- X (void) InitMenu();
- X (void) StartMenus();
- X }
- X
- Xvoid handle_MENUPICK( class, code )
- Xunsigned long class;
- Xunsigned int code;
- X{
- X unsigned int menunum, itemnum, subnum;
- X
- X if (code == MENUNULL) return;
- X
- X menunum = MENUNUM( code );
- X itemnum = ITEMNUM( code );
- X subnum = SUBNUM( code );
- X chgflag = TRUE;
- X switch( menunum ) {
- X case 0:
- X switch( itemnum ) {
- X case 0:
- X WindowToFront(window);
- X break;
- X
- X case 1:
- X WindowToBack(window);
- X break;
- X
- X case 2:
- X things_are_cool = FALSE; /* Quit */
- X break;
- X } /* end of switch ( Project itemnum ) */
- X break;
- X
- X case 1:
- X switch( itemnum ) {
- X case 0:
- X switch( subnum ) {
- X case 0:
- X mode = FRAGS ; /* Frags mode */
- X break;
- X
- X case 1:
- X mmode = TRUE ; /* Warps request */
- X break;
- X /* end of switch ( Mode subnum ) */
- X }
- X break;
- X case 1:
- X switch( subnum ) {
- X case 0:
- X delayval = 1;
- X break;
- X
- X case 1:
- X delayval = 2;
- X break;
- X
- X case 2:
- X delayval = 5;
- X break;
- X
- X case 3:
- X delayval = 10;
- X break;
- X /* end of switch ( Freq subnum ) */
- X }
- X break;
- X /* end of switch ( Setup itemnum ) */
- X }
- X break;
- X
- X case 2:
- X switch( itemnum ) {
- X case 0:
- X priority = lastpri;
- X break;
- X
- X case 1:
- X priority = priority - 1;
- X break;
- X
- X case 2:
- X priority = priority + 1;
- X break;
- X
- X case 3:
- X priority = -99;
- X lastpri = priority;
- X break;
- X
- X case 4:
- X priority = -75;
- X lastpri = priority;
- X break;
- X
- X case 5:
- X priority = -50;
- X lastpri = priority;
- X break;
- X
- X case 6:
- X priority = -25;
- X lastpri = priority;
- X break;
- X
- X case 7:
- X priority = -20;
- X lastpri = priority;
- X break;
- X
- X case 8:
- X priority = -15;
- X lastpri = priority;
- X break;
- X
- X case 9:
- X priority = -10;
- X lastpri = priority;
- X break;
- X
- X case 10:
- X priority = -5;
- X lastpri = priority;
- X break;
- X
- X case 11:
- X priority = 0;
- X lastpri = priority;
- X break;
- X
- X case 12:
- X priority = 5;
- X lastpri = priority;
- X break;
- X
- X case 13:
- X priority = 10;
- X lastpri = priority;
- X break;
- X
- X case 14:
- X priority = 15;
- X lastpri = priority;
- X break;
- X
- X case 15:
- X priority = 20;
- X lastpri = priority;
- X break;
- X }
- X /* end of switch ( Priority itemnum ) */
- X break;
- X
- X case 3:
- X switch( itemnum ) {
- X case 0:
- X cmemsize = 0x000000;
- X break;
- X
- X case 1:
- X cmemsize = 0x040000;
- X break;
- X
- X case 2:
- X cmemsize = 0x080000;
- X break;
- X
- X case 3:
- X cmemsize = 0x100000;
- X break;
- X
- X case 4:
- X cmemsize = 0x200000;
- X break;
- X }
- X /* end of switch ( Chip Size itemnum ) */
- X break;
- X
- X case 4:
- X switch( itemnum ) {
- X case 0:
- X cmembase = 0x000000;
- X break;
- X
- X case 1:
- X cmembase = 0x040000;
- X break;
- X
- X case 2:
- X cmembase = 0x080000;
- X break;
- X
- X case 3:
- X cmembase = 0x100000;
- X break;
- X }
- X /* end of switch ( Chip Addr itemnum ) */
- X break;
- X
- X case 5:
- X if (mode == WARPS) mmode = TRUE ;
- X switch( itemnum ) {
- X case 0:
- X sfmemsize = 0x000000;
- X break;
- X
- X case 1:
- X sfmemsize = 0x040000;
- X break;
- X
- X case 2:
- X sfmemsize = 0x080000;
- X break;
- X
- X case 3:
- X sfmemsize = 0x0C0000;
- X break;
- X
- X case 4:
- X sfmemsize = 0x100000;
- X break;
- X
- X case 5:
- X sfmemsize = 0x180000;
- X break;
- X
- X case 6:
- X sfmemsize = 0x200000;
- X break;
- X
- X case 7:
- X sfmemsize = 0x300000;
- X break;
- X
- X case 8:
- X sfmemsize = 0x400000;
- X break;
- X
- X case 9:
- X sfmemsize = 0x600000;
- X break;
- X
- X case 10:
- X sfmemsize = 0x800000;
- X break;
- X }
- X /* end of switch ( SF Size itemnum ) */
- X break;
- X
- X case 6:
- X if (mode == WARPS) mmode = TRUE ;
- X switch( itemnum ) {
- X case 0:
- X sfmembase = 0x200000;
- X break;
- X
- X case 1:
- X sfmembase = 0x240000;
- X break;
- X
- X case 2:
- X sfmembase = 0x280000;
- X break;
- X
- X case 3:
- X sfmembase = 0x2C0000;
- X break;
- X
- X case 4:
- X sfmembase = 0x300000;
- X break;
- X
- X case 5:
- X sfmembase = 0x400000;
- X break;
- X
- X case 6:
- X sfmembase = 0x500000;
- X break;
- X
- X case 7:
- X sfmembase = 0x600000;
- X break;
- X
- X case 8:
- X sfmembase = 0x700000;
- X break;
- X
- X case 9:
- X sfmembase = 0x800000;
- X break;
- X
- X case 10:
- X sfmembase = 0x900000;
- X break;
- X
- X case 11:
- X sfmembase = 0xC00000;
- X break;
- X
- X case 12:
- X sfmembase = 0xC40000;
- X break;
- X
- X case 13:
- X sfmembase = 0xC80000;
- X break;
- X
- X case 14:
- X sfmembase = 0xCC0000;
- X break;
- X
- X case 15:
- X sfmembase = 0xD00000;
- X break;
- X }
- X /* end of switch ( SF Addr itemnum ) */
- X break;
- X
- X case 7:
- X if (mode == WARPS) mmode = TRUE ;
- X switch( itemnum ) {
- X case 0:
- X fmemsize = 0x000000;
- X break;
- X
- X case 1:
- X fmemsize = 0x040000;
- X break;
- X
- X case 2:
- X fmemsize = 0x080000;
- X break;
- X
- X case 3:
- X fmemsize = 0x0C0000;
- X break;
- X
- X case 4:
- X fmemsize = 0x100000;
- X break;
- X
- X case 5:
- X fmemsize = 0x200000;
- X break;
- X
- X case 6:
- X fmemsize = 0x300000;
- X break;
- X
- X case 7:
- X fmemsize = 0x400000;
- X break;
- X
- X case 8:
- X fmemsize = 0x600000;
- X break;
- X
- X case 9:
- X fmemsize = 0x800000;
- X break;
- X
- X case 10:
- X fmemsize = 0xa000000;
- X break;
- X
- X case 11:
- X fmemsize = 0xc00000;
- X break;
- X
- X case 12:
- X fmemsize = 0xd00000;
- X break;
- X
- X case 13:
- X fmemsize = 0xe00000;
- X break;
- X
- X case 14:
- X fmemsize = 0xf00000;
- X break;
- X
- X case 15:
- X fmemsize = 0x1000000;
- X break;
- X }
- X /* end of switch ( Fast Size itemnum ) */
- X break;
- X
- X case 8:
- X if (mode == WARPS) mmode = TRUE ;
- X switch( itemnum ) {
- X case 0:
- X fmembase = 0x200000;
- X break;
- X
- X case 1:
- X fmembase = 0x300000;
- X break;
- X
- X case 2:
- X fmembase = 0x400000;
- X break;
- X
- X case 3:
- X fmembase = 0x500000;
- X break;
- X
- X case 4:
- X fmembase = 0x600000;
- X break;
- X
- X case 5:
- X fmembase = 0x800000;
- X break;
- X
- X case 6:
- X fmembase = 0x7f0000;
- X break;
- X
- X case 7:
- X fmembase = 0x7e0000;
- X break;
- X
- X case 8:
- X fmembase = 0x7d00000;
- X break;
- X
- X case 9:
- X fmembase = 0x7c00000;
- X break;
- X
- X case 10:
- X fmembase = 0x7a00000;
- X break;
- X
- X case 11:
- X fmembase = 0x7800000;
- X break;
- X
- X case 12:
- X fmembase = 0x7600000;
- X break;
- X
- X case 13:
- X fmembase = 0x7400000;
- X break;
- X
- X case 14:
- X fmembase = 0x7200000;
- X break;
- X
- X case 15:
- X fmembase = 0x7000000;
- X break;
- X }
- X /* end of switch ( Fast Addr itemnum ) */
- X break;
- X }
- X /* end of switch ( menunum ) */
- X}
- X
- Xvoid wrack_sploot() /* this subprogram cashes in the chips in bad times */
- X {
- X if (log != 0) {
- X if (log & SA) {
- X (void) FreeMem(oldcsum, (long)(sizeof(ULONG) * warps)) ;
- X log = log & CA ;
- X }
- X if (log & S8) {
- X (void) FreeMem(csum, (long)(sizeof(ULONG) * warps)) ;
- X log = log & C8 ;
- X }
- X if (log & S4) {
- X (void) FreeMem(sizev, (long)(sizeof(long) * frags)) ;
- X log = log & C4 ;
- X }
- X if (log & S2) {
- X (void) FreeMem(chunkv, (long)(sizeof(long) * frags)) ;
- X log = log & C2 ;
- X }
- X if (log & S1) {
- X (void) FreeMem(cell, (long)(sizeof(USHORT) * warps)) ;
- X log = log & C1 ;
- X }
- X frags = 0;
- X warps = 0;
- X }
- X}
- X
- XSetTimer(sec, micro, timermsg)
- XULONG sec, micro;
- Xstruct IOStdReq *timermsg;
- X/* This routine simply sets the timer to interrupt us after secs.micros */
- X{
- X timermsg->io_Command = TR_ADDREQUEST; /* add a new timer request */
- X timermsg->io_Actual = sec; /* seconds */
- X timermsg->io_Length = micro; /* microseconds */
- X SendIO(timermsg); /* post a request to the timer */
- X}
- X
- Xvoid cleanup() {
- X if (timerport) {
- X Wait(timerbit);
- X GetMsg(timerport);
- X CloseDevice(timermsg);
- X DeleteStdIO(timermsg);
- X DeletePort(timerport);
- X }
- X if (GfxBase) CloseLibrary(GfxBase) ;
- X if (window) CloseWindow(window) ;
- X if (IntuitionBase) CloseLibrary(IntuitionBase) ;
- X wrack_sploot() ;
- X exit(AARRRGH) ;
- X}
- X
- Xvoid inittimer() {
- X if(!(timerport = (struct MsgPort *)CreatePort(0L, 0L)))cleanup();
- X if(!(timermsg = (struct IOStdReq *)CreateStdIO(timerport)))cleanup();
- X if (OpenDevice(TIMERNAME, UNIT_VBLANK, timermsg, 0L))cleanup();
- X
- X timerbit = 1L << timerport->mp_SigBit ;
- X SetTimer(1L, 0L, timermsg); /* set for first message */
- X}
- X
- Xvoid handle_NEWSIZE() /* short term allocations cashed in then realloc'd */
- X { /* when user hits gadget but doesn't resize window */
- X if (log & SA) {
- X (void) FreeMem(oldcsum, (long)(sizeof(ULONG) * warps)) ;
- X log = log & CA ;
- X }
- X if (log & S8) {
- X (void) FreeMem(csum, (long)(sizeof(ULONG) * warps)) ;
- X log = log & C8 ;
- X }
- X if (log & S1) {
- X (void) FreeMem(cell, (long)(sizeof(USHORT) * warps)) ;
- X log = log & C1 ;
- X barh = window->Height - SIZEGAD - DRAGBAR ; /* recalculate height */
- X barb = window->Height - SIZEGAD - 1 ; /* get new bar base position */
- X warps = barh + 1 ; /* number of storage cells to be reserved */
- X if ((cell = (USHORT *)AllocMem((long)sizeof(USHORT) * warps,
- X MEMF_PUBLIC)) != 0L ) log = log | S1;
- X if ((csum = (ULONG *)AllocMem((long)sizeof(ULONG) * warps,
- X MEMF_PUBLIC)) != 0L ) log = log | S8;
- X if ((oldcsum = (ULONG *)AllocMem((long)sizeof(ULONG) * warps,
- X MEMF_PUBLIC)) != 0L ) log = log | SA;
- X if (log != SOK) { /* bail out if we didn't get an allocation */
- X wrack_sploot() ;
- X things_are_cool = FALSE ; /* tell _main that we're leaving */
- X }
- X e_text.TopEdge = barb + BORDER ; /* set the E text position */
- X intsig = FALSE ;
- X }
- X}
- X
- Xvoid handle_MESSAGES() {
- X unsigned long class;
- X unsigned int code, qual;
- X
- X /* Wait (1L << window->UserPort->mp_SigBit); this is rediculous! */
- X while ((message=(struct IntuiMessage *)GetMsg(window->UserPort))
- X != 0L) {
- X class = message->Class ;
- X code = message->Code ;
- X qual = message->Qualifier ;
- X ReplyMsg ;
- X ticker = 0 ; /* cut short the timer to expedite service */
- X switch( class ) {
- X case MENUPICK:
- X handle_MENUPICK( class, code ) ; /* do menus ASAP */
- X break ;
- X
- X case NEWSIZE:
- X intsig = TRUE ; /* resize when done here */
- X break ;
- X }
- X }
- X}
- X
- Xvoid memmometer() /* this subprogram draws the bar graphs */
- X {
- X long i;
- X long y;
- X
- X (void) handle_MESSAGES() ; /* go see if the user wants anything */
- X i = 0 ;
- X while ((i < barh) && (intsig == FALSE)) {
- X y = barb - i ;
- X SetAPen(window->RPort, (long)cell[i]);
- X Move(window->RPort, xl, y);
- X Draw(window->RPort, xr, y);
- X i++ ;
- X }
- X}
- X
- Xvoid shake() /* this subprogram slings down the mercury column */
- X {
- X int i;
- X
- X for (i = 0; i < barh; i++) {
- X cell[i] = YELP ;
- X }
- X}
- X
- Xvoid lockout() /* this subprogram renders a whole column in border colors */
- X {
- X (void) handle_MESSAGES() ; /* go see if the user wants anything */
- X if (intsig == FALSE) {
- X SetAPen(window->RPort, WHTP) ; /* set in the border color */
- X RectFill(window->RPort, xl, (barb - barh + 1), xr, barb) ; /* fill */
- X }
- X}
- X
- Xvoid updatewarps( wf, membase, memseg ) /* this subprogram finds changes */
- Xshort wf;
- Xlong membase, memseg ;
- X {
- X register long i ;
- X register ULONG r ;
- X register ULONG delta ;
- X register ULONG *a ;
- X
- X if (memseg == 0) {
- X (void) lockout() ;
- X return ;
- X }
- X else (void) shake() ;
- X
- X delta = (ULONG)(memseg & EVENMASK) ; /* try to avoid odd address trap */
- X r = (ULONG)(membase & EVENMASK) ; /* prefer wrong address to death */
- X for (i = 0; i < barh; i++) {
- X csum[i] = 0 ;
- X }
- X for (i = 0; i < barh; i++) {
- X for (a = (ULONG *)r; a < (ULONG *)(r + delta); a++) {
- X csum[i] ^= *a ;
- X }
- X if (oldcsum[i] != 0) cell[i] ^= GRNP ; /* enters with pens */
- X if (csum[i] == oldcsum[i]) cell[i] &= GRNP ; /* all on, condition */
- X if (csum[i] == 0) cell[i] ^= CYNP ; /* detected clears a */
- X if (oldcsum[i] == 0xffffffff) cell[i] = CYNP ;/* pen; at the end a */
- X if (csum[i] == 0xffffffff) cell[i] = GRNP ; /* logical true sets */
- X oldcsum[i] = csum[i] ; /* a pen not yet set */
- X r += delta ;
- X }
- X (void) memmometer();
- X}
- X
- Xvoid updatescreen( wf, membase, memseg )
- Xshort wf;
- Xlong membase, memseg;
- X {
- X register long size ;
- X register struct MemHeader *hdr ;
- X register struct MemChunk *chunk ;
- X extern struct ExecBase *SysBase ;
- X register long *which ; /* active memlist chunk pointer */
- X register long newlimit ; /* number of chunks, incl 1 null chunk, + 1 */
- X register long newfrags ; /* number of chunks, incl null chunks, + 1 */
- X long newsize ; /* size of next request for chunkv/sizev memory, + 1 */
- X int i, j, k, l ;
- X int length ; /* length is number of chunks to be processed, + 1 */
- X BOOL cf, nf ; /* cf is "chip flag" nf is "null chunk found" flag */
- X
- X if (memseg == 0) {
- X (void) lockout() ;
- X return;
- X }
- X else (void) shake() ;
- X
- X for (i = 0; i < 3; i++) {
- X chip[i] = 0;
- X fast[i] = 0;
- X }
- X for (i = 0; i < frags; i++) {
- X chunkv[i] = 0;
- X sizev[i] = 0;
- X }
- X newfrags = 0 ;
- X newlimit = 0 ;
- X nf = FALSE;
- X Forbid() ;
- X hdr = (struct MemHeader *) SysBase->MemList.lh_Head ;
- X while (hdr->mh_Node.ln_Succ) {
- X if (hdr->mh_Attributes & MEMF_CHIP) {
- X which = chip ;
- X cf = TRUE;
- X }
- X else {
- X which = fast ;
- X cf = FALSE;
- X }
- X if (((cf == TRUE) && (wf == 0)) || ((cf == FALSE) && (wf > 0))) {
- X for (chunk = hdr->mh_First; chunk; chunk = chunk->mc_Next) {
- X if (which[1] < frags) chunkv[which[1]++] = (unsigned long)chunk ;
- X size = chunk->mc_Bytes ;
- X if (which[2] < frags) sizev[which[2]++] = (unsigned long)size;
- X *which += size ;
- X if (nf == FALSE) {
- X newlimit++ ;
- X if (chunkv[newfrags] == NULL) {
- X nf = TRUE;
- X }
- X }
- X newfrags++ ;
- X }
- X }
- X hdr = (struct MemHeader *)hdr->mh_Node.ln_Succ ;
- X }
- X Permit() ;
- X length = frags ;
- X if (newlimit < frags) length = newlimit ;
- X for (i = 0; i < length; i++) {
- X chunkv[i] -= membase; /* chunkv is now array offset from base */
- X sizev[i] += chunkv[i]; /* and sizev is now address of array top */
- X chunkv[i] = chunkv[i] / memseg; /* this is the number of pixels */
- X sizev[i] = sizev[i] / memseg; /* and this is the top pixel */
- X if (chunkv[i] < 0) chunkv[i] = 0 ; /* we do some bounds checking */
- X if (sizev[i] < 0) sizev[i] = 0 ;
- X if (chunkv[i] >= barh) chunkv[i] = barh - 1 ;
- X if (sizev[i] >= barh) sizev[i] = barh - 1 ;
- X if (sizev[i] - chunkv[i] < 0) sizev[i] = chunkv[i] ;
- X j = chunkv[i] ; /* from now on it will be less confusing if */
- X k = sizev[i] ; /* we assign some variables for this stuff */
- X if (sizev[i] - chunkv[i] == 0) {
- X cell[j] &= BLUP ;
- X }
- X else {
- X for (l = j; l < k; l++) {
- X cell[l] &= BLKP ;
- X }
- X }
- X }
- X (void) memmometer();
- X newsize = frags ;
- X while (newsize < newlimit) {
- X newsize += EXTENSION ;
- X }
- X if (newlimit > frags) {
- X (void) FreeMem(chunkv, (long)(sizeof(long) * frags));
- X if ((chunkv = (unsigned long *)AllocMem((long)sizeof(long) * newsize,
- X MEMF_PUBLIC)) == 0L ) {
- X log = log & C2 ;
- X }
- X (void) FreeMem(sizev, (long)(sizeof(long) * frags));
- X if ((sizev = (unsigned long *)AllocMem((long)sizeof(long) * newsize,
- X MEMF_PUBLIC)) == 0L ) {
- X (void) FreeMem(chunkv, (long)(sizeof(long) * newsize));
- X log = log & C4 ;
- X }
- X if (log != SOK) {
- X wrack_sploot() ;
- X things_are_cool = FALSE ;
- X }
- X else frags = newsize ;
- X }
- X}
- X
- Xmain() {
- X static struct IntuiText bodyText0 =
- X {BLUP, WHTP, JAM2, 58, 10, NULL, NULL, NULL};
- X static struct IntuiText bodyText1 =
- X {BLUP, WHTP, JAM2, 42, 20, NULL, NULL, NULL};
- X static struct IntuiText bodyText2 =
- X {BLUP, WHTP, JAM2, 50, 30, NULL, NULL, NULL};
- X static struct IntuiText positiveText =
- X {BLUP, WHTP, JAM2, 7, 3, NULL, NULL, NULL};
- X static struct IntuiText negativeText =
- X {BLUP, WHTP, JAM2, 7, 3, NULL, NULL, NULL};
- X struct IntuiMessage *message;
- X ULONG class;
- X USHORT code;
- X ULONG wakeupbits;
- X long syspri;
- X char *nptr;
- X struct Task *mmtcb;
- X char oldpri;
- X int t;
- X int i;
- X USHORT colflags; /* keeps track of column positions and counts */
- X USHORT left; /* left column, left edge */
- X USHORT middle; /* middle column, left edge */
- X USHORT right; /* right column, left edge */
- X USHORT barw; /* width of each mercury column */
- X USHORT wf; /* memmometer window current column number */
- X long cmemseg;
- X long sfmemseg;
- X long fmemseg;
- X long membase;
- X long memseg;
- X long memsize;
- X
- X bodyText0.IText = (UBYTE *) "WARNING! CRASH POSSIBLE";
- X bodyText1.IText = (UBYTE *) "MENU MEMORY SELECTIONS MUST";
- X bodyText2.IText = (UBYTE *) "REFERENCE EXISTING MEMORY";
- X bodyText0.NextText = &bodyText1;
- X bodyText1.NextText = &bodyText2;
- X positiveText.IText = (UBYTE *) "Risk It";
- X negativeText.IText = (UBYTE *) "Retreat";
- X
- X log = 0 ;
- X if ((cell = (USHORT *)AllocMem((long)sizeof(USHORT) * BARS,
- X MEMF_PUBLIC)) != 0L ) log = log | S1;
- X if ((chunkv = (ULONG *)AllocMem((long)sizeof(ULONG) * STARTVAL,
- X MEMF_PUBLIC)) != 0L ) log = log | S2;
- X if ((sizev = (ULONG *)AllocMem((long)sizeof(ULONG) * STARTVAL,
- X MEMF_PUBLIC)) != 0L ) log = log | S4;
- X if ((csum = (ULONG *)AllocMem((long)sizeof(ULONG) * BARS,
- X MEMF_PUBLIC)) != 0L ) log = log | S8;
- X if ((oldcsum = (ULONG *)AllocMem((long)sizeof(ULONG) * BARS,
- X MEMF_PUBLIC)) != 0L ) log = log | SA;
- X if (log != SOK) {
- X wrack_sploot() ;
- X exit(AARRRGH) ;
- X }
- X if ((IntuitionBase = (struct IntuitionBase *)OpenLibrary(
- X "intuition.library",33L)) != NULL &&
- X (window=OpenWindow(&newwindow)) != NULL) {
- X if ((GfxBase = (struct GfxBase *)OpenLibrary(
- X "graphics.library", 0L)) != NULL) {
- X (void) initmenus();
- X /* rp = window->RPort ; */
- X inittimer();
- X wf = 0;
- X mmode = FALSE ;
- X mode = FRAGS ;
- X delayval = p_rate ;
- X priority = p_priority ;
- X if (priority > 0) priority = 0 ;
- X lastpri = priority ;
- X syspri = priority ;
- X nptr = NULL ;
- X mmtcb = FindTask( nptr ) ;
- X oldpri = SetTaskPri( mmtcb, syspri ) ;
- X cmemsize = p_chip << 10 ;
- X cmembase = p_chipa << 10 ;
- X sfmemsize = p_sf << 10 ;
- X sfmembase = p_sfa << 10 ;
- X if (p_fast >= 256) fmemsize = p_fast << 10 ;
- X else fmemsize = p_fast << 20 ;
- X if (p_fasta <= 0) fmembase = 0x8000000 - ((-1 * p_fasta) << 20) ;
- X else fmembase = p_fasta << 20 ;
- X while (things_are_cool == TRUE) {
- X if (chgflag != 0) {
- X chgflag = 0 ;
- X colflags = 0 ;
- X if (cmemsize != 0) colflags = colflags | (1 << 0) ;
- X if (sfmemsize != 0) colflags = colflags | (1 << 1) ;
- X if (fmemsize != 0) colflags = colflags | (1 << 2) ;
- X switch ( colflags ) {
- X case 0:
- X barw = (WINW - (2 * BORDER)) - 1 ;
- X left = LEFT ;
- X middle = 0 ;
- X right = 0 ;
- X f_text.FrontPen = ORNP ;
- X break ;
- X
- X case 1:
- X barw = (WINW - (2 * BORDER)) - 1 ;
- X left = LEFT ;
- X middle = 0 ;
- X right = 0 ;
- X f_text.FrontPen = BLUP ;
- X break ;
- X
- X case 2:
- X barw = (WINW - (2 * BORDER)) - 1 ;
- X left = 0 ;
- X middle = LEFT ;
- X right = 0 ;
- X f_text.FrontPen = CYNP ;
- X break ;
- X
- X case 3:
- X barw = ((WINW - (2 * BORDER)) / 2 ) - 1 ;
- X left = LEFT ;
- X middle = (left + barw + 1) ;
- X right = 0 ;
- X f_text.FrontPen = BLUP ;
- X break ;
- X
- X case 4:
- X barw = (WINW - (2 * BORDER)) - 1 ;
- X left = 0 ;
- X middle = 0;
- X right = LEFT ;
- X f_text.FrontPen = YELP ;
- X break ;
- X
- X case 5:
- X barw = ((WINW - (2 * BORDER)) / 2 ) - 1 ;
- X left = LEFT ;
- X middle = 0 ;
- X right = (left + barw + 1) ;
- X f_text.FrontPen = CYNP ;
- X break ;
- X
- X case 6:
- X barw = ((WINW - (2 * BORDER)) / 2 ) - 1 ;
- X left = 0 ;
- X middle = LEFT ;
- X right = (middle + barw + 1) ;
- X f_text.FrontPen = YELP ;
- X break ;
- X
- X case 7:
- X barw = ((WINW - (2 * BORDER)) / 3 ) - 1 ;
- X left = LEFT ;
- X middle = (left + barw + 1) ;
- X right = (middle + barw + 1) ;
- X f_text.FrontPen = BLUP ;
- X break ;
- X } /* end of switch ( colflags ) */
- X } /* end of if ( chgflag ) */
- X cmemseg = cmemsize / barh ;
- X sfmemseg = sfmemsize / barh ;
- X fmemseg = fmemsize / barh ;
- X if (mmode == TRUE && ((sfmemsize != 0) ||
- X (fmemsize != 0))) {
- X /* Keep your eyes open here. If we get a negative */
- X /* response from the requester, that means either the */
- X /* user retreated, or a no-requester function such as */
- X /* noreq or KillReq has selected the negative option. */
- X /* If such functions select the positive option they */
- X /* force acceptance of the crash risk for Warps mode. */
- X
- X mode = AutoRequest(window, &bodyText0, &positiveText,
- X &negativeText, 0L, 0L, 319L, 79L) ;
- X if (mode == FALSE) { /* user Retreat selection */
- X sfmemseg = 0 ; /* results in execution of */
- X sfmemsize = 0 ; /* this code segment which */
- X fmemseg = 0 ; /* resets to safer values */
- X fmemsize = 0 ; /* resets to safer values */
- X }
- X }
- X switch ( wf ) {
- X case 0:
- X xl = left ;
- X membase = cmembase ;
- X memseg = cmemseg ;
- X memsize = cmemsize ;
- X break;
- X
- X case 1:
- X xl = middle ;
- X membase = sfmembase ;
- X memseg = sfmemseg ;
- X memsize = sfmemsize ;
- X break;
- X
- X case 2:
- X xl = right ;
- X membase = fmembase ;
- X memseg = fmemseg ;
- X memsize = fmemsize ;
- X break;
- X } /* end of switch ( wf ) */
- X xr = xl + barw ;
- X if (mmode == TRUE) {
- X mode = WARPS ;
- X mmode = FALSE ;
- X }
- X if (xl != 0) {
- X if (intsig == TRUE) {
- X handle_NEWSIZE() ;
- X }
- X if (mode == WARPS) {
- X (void) updatewarps( wf, membase, memseg ) ;
- X e_text.FrontPen = YELP ;
- X }
- X if (mode == FRAGS) {
- X (void) updatescreen( wf, membase, memseg ) ;
- X e_text.FrontPen = BLUP ;
- X }
- X }
- X if (syspri != priority) {
- X syspri = priority ;
- X nptr = NULL;
- X mmtcb = FindTask( nptr ) ;
- X oldpri = SetTaskPri( mmtcb, syspri ) ;
- X }
- X if (wf == 2) {
- X PrintIText(window->RPort,&f_text,RTEXT,0L) ;
- X while ( ticker > 0 ) {
- X wakeupbits = Wait(timerbit) ;
- X if (wakeupbits & timerbit) {
- X GetMsg(timerport);
- X SetTimer(0L, TMARK, timermsg);
- X }
- X /* quick like, go see if the user wants anything */
- X (void) handle_MESSAGES() ;
- X ticker-- ;
- X }
- X ticker = delayval * TICKIES ;
- X }
- X wf++ ;
- X if (wf >= 3) wf = 0 ;
- X if (intsig == TRUE) {
- X handle_NEWSIZE() ;
- X }
- X } /* end of while ( things_are_cool) */
- X
- X if (timerport) {
- X Wait(timerbit);
- X GetMsg(timerport);
- X CloseDevice(timermsg);
- X DeleteStdIO(timermsg);
- X DeletePort(timerport);
- X }
- X
- X if (GfxBase) CloseLibrary(GfxBase) ;
- X }
- X if (window) CloseWindow(window) ;
- X if (IntuitionBase) CloseLibrary(IntuitionBase) ;
- X }
- X wrack_sploot() ;
- X}
- X
- X_cli_parse() {}
- X_wb_parse() {}
- END_OF_FILE
- if test 38693 -ne `wc -c <'mm.c'`; then
- echo shar: \"'mm.c'\" unpacked with wrong size!
- fi
- # end of 'mm.c'
- fi
- if test -f 'mminit.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'mminit.c'\"
- else
- echo shar: Extracting \"'mminit.c'\" \(27558 characters\)
- sed "s/^X//" >'mminit.c' <<'END_OF_FILE'
- X/* : ai=0 bk=0 ts=8 */
- X#include "mm.h"
- X
- X#define PROJMAX 3 /* number of project menu items */
- X#define SETUPMAX 2 /* number of setup menu items */
- X#define MODEMAX 2
- X#define FREQMAX 4 /* number of frequency menu items */
- X#define PRIOMAX 16 /* number of priority menu items */
- X#define CHIPMAX 5 /* number of chip mem size menu items */
- X#define CHIPAMAX 6 /* number of chip mem base addr menu items */
- X#define SFMAX 11 /* number of sf mem size menu items */
- X#define SFAMAX 16 /* number of sf mem base addr menu items */
- X#define FASTMAX 16 /* number of fast mem size menu items */
- X#define FASTAMAX 16 /* number of fast mem base addr menu items */
- X#define MAXMENU 9 /* total number of top level menus */
- X
- Xextern BOOL p_mode; /* preset frags mode = 0, warps mode = 1 */
- Xextern long p_rate; /* preset sample interval, secs see menu */
- Xextern long p_priority; /* preset priority, range -100 to +100 */
- Xextern long p_chip; /* preset chip mem size, kbytes see menu */
- Xextern long p_chipa; /* preset chip mem address, kb see menu */
- Xextern long p_sf; /* preset slowfast mem size, kb see menu */
- Xextern long p_sfa; /* preset slowfast mem addr, kb see menu */
- Xextern long p_fast; /* preset fast mem size, mbytes see menu */
- Xextern long p_fasta; /* preset fast mem addr, mbytes see menu */
- X
- X/******************************************************/
- X/* Structure declarations for the menu sections */
- X/******************************************************/
- X
- Xstruct MenuItem ProjItem[PROJMAX];
- Xstruct IntuiText ProjText[PROJMAX];
- Xstruct MenuItem SetupItem[SETUPMAX];
- Xstruct IntuiText SetupText[SETUPMAX];
- Xstruct MenuItem ModeItem[MODEMAX];
- Xstruct IntuiText ModeText[MODEMAX];
- Xstruct MenuItem FreqItem[FREQMAX];
- Xstruct IntuiText FreqText[FREQMAX];
- Xstruct MenuItem PrioItem[PRIOMAX];
- Xstruct IntuiText PrioText[PRIOMAX];
- Xstruct MenuItem ChipItem[CHIPMAX];
- Xstruct IntuiText ChipText[CHIPMAX];
- Xstruct MenuItem ChipAItem[CHIPAMAX];
- Xstruct IntuiText ChipAText[CHIPAMAX];
- Xstruct MenuItem SFItem[SFMAX];
- Xstruct IntuiText SFText[SFMAX];
- Xstruct MenuItem SFAItem[SFAMAX];
- Xstruct IntuiText SFAText[SFAMAX];
- Xstruct MenuItem FastItem[FASTMAX];
- Xstruct IntuiText FastText[FASTMAX];
- Xstruct MenuItem FastAItem[FASTAMAX];
- Xstruct IntuiText FastAText[FASTAMAX];
- Xstruct Menu menu[MAXMENU];
- X
- X/*****************************************************************/
- X/* The following function initializes the structure arrays */
- X/* needed to provide the Project menu topic. */
- X/* this was left retro-compatible with Manx 3.4a (nplus1) */
- X/*****************************************************************/
- Xvoid InitProjItems()
- X {
- X int n,nplus1;
- X
- X/* initialize each menu item and IntuiText with loop */
- Xfor( n=0; n<PROJMAX; n++ )
- X {
- X nplus1 = n + 1;
- X ProjItem[n].NextItem = &ProjItem[nplus1];
- X ProjItem[n].LeftEdge = 0;
- X ProjItem[n].TopEdge = 9 * n;
- X ProjItem[n].Width = 64;
- X ProjItem[n].Height = 9;
- X ProjItem[n].Flags = ITEMTEXT | ITEMENABLED | HIGHCOMP;
- X ProjItem[n].MutualExclude = 0;
- X ProjItem[n].ItemFill = (APTR)&ProjText[n];
- X ProjItem[n].SelectFill = NULL;
- X ProjItem[n].Command = 0;
- X ProjItem[n].SubItem = NULL;
- X ProjItem[n].NextSelect = 0;
- X
- X ProjText[n].FrontPen = BLUP;
- X ProjText[n].BackPen = WHTP;
- X ProjText[n].DrawMode = JAM2;/* render in fore and background */
- X ProjText[n].LeftEdge = 0;
- X ProjText[n].TopEdge = 1;
- X ProjText[n].ITextFont = NULL;
- X ProjText[n].NextText = NULL;
- X }
- XProjItem[PROJMAX-1].NextItem = NULL;
- X
- X/* initialize text for specific menu items */
- X
- XProjText[0].IText = (UBYTE *)"Front";
- XProjText[1].IText = (UBYTE *)"Back";
- XProjText[2].IText = (UBYTE *)"Quit";
- X}
- X
- X/*****************************************************************/
- X/* The following initializes the structure arrays */
- X/* needed to provide the Setup menu topic. */
- X/*****************************************************************/
- X
- Xvoid InitSetupItems()
- X {
- X int n,nplus1;
- X
- X/* initialize each menu item and IntuiText with loop */
- Xfor( n=0; n<SETUPMAX; n++ )
- X {
- X nplus1 = n + 1;
- X SetupItem[n].NextItem = &SetupItem[nplus1];
- X SetupItem[n].LeftEdge = 0;
- X SetupItem[n].TopEdge = 9 * n;
- X SetupItem[n].Width = 44;
- X SetupItem[n].Height = 9;
- X SetupItem[n].Flags = ITEMTEXT | ITEMENABLED | HIGHCOMP ;
- X SetupItem[n].MutualExclude = 0;
- X SetupItem[n].ItemFill = (APTR)&SetupText[n];
- X SetupItem[n].SelectFill = NULL;
- X SetupItem[n].Command = 0;
- X SetupItem[n].NextSelect = 0;
- X
- X SetupText[n].FrontPen = BLUP;
- X SetupText[n].BackPen = WHTP;
- X SetupText[n].DrawMode = JAM2;
- X SetupText[n].LeftEdge = 0;
- X SetupText[n].TopEdge = 1;
- X SetupText[n].ITextFont = NULL;
- X SetupText[n].NextText = NULL;
- X }
- XSetupItem[SETUPMAX-1].NextItem = NULL;
- X
- XSetupText[0].IText = (UBYTE *)"Mode";
- XSetupItem[0].SubItem = ModeItem;
- XSetupText[1].IText = (UBYTE *)"Freq";
- XSetupItem[1].SubItem = FreqItem;
- X
- X/*****************************************************************/
- X/* The following initializes the structure arrays */
- X/* needed to provide the Mode submenu topic. */
- X/*****************************************************************/
- X
- Xfor( n=0; n<MODEMAX; n++ )
- X {
- X nplus1 = n + 1;
- X ModeItem[n].NextItem = &ModeItem[nplus1];
- X ModeItem[n].LeftEdge = 38;
- X ModeItem[n].TopEdge = 9 * n;
- X ModeItem[n].Width = 72;
- X ModeItem[n].Height = 9;
- X ModeItem[n].Flags = ITEMTEXT | ITEMENABLED | HIGHCOMP | CHECKIT;
- X ModeItem[n].MutualExclude = (~(1 << n));
- X ModeItem[n].ItemFill = (APTR)&ModeText[n];
- X ModeItem[n].SelectFill = NULL;
- X ModeItem[n].Command = 0;
- X ModeItem[n].SubItem = NULL;
- X ModeItem[n].NextSelect = 0;
- X
- X ModeText[n].FrontPen = BLUP;
- X ModeText[n].BackPen = WHTP;
- X ModeText[n].DrawMode = JAM2; /* render in fore and background */
- X ModeText[n].LeftEdge = 0;
- X ModeText[n].TopEdge = 1;
- X ModeText[n].ITextFont = NULL;
- X ModeText[n].NextText = NULL;
- X }
- XModeItem[MODEMAX-1].NextItem = NULL;
- X
- X/* select mode subitem checked */
- Xswitch (p_mode) {
- X case 0: n = 0; break;
- X case 1: n = 1; break;
- X default: n = 1; p_mode = FALSE;
- X }
- XModeItem[n].Flags |= CHECKED;
- X
- X/* initialize text for specific submenu items */
- XModeText[0].IText = (UBYTE *)" Frags";
- XModeText[1].IText = (UBYTE *)" Warps";
- X
- X/*****************************************************************/
- X/* The following initializes the structure arrays */
- X/* needed to provide the Freq submenu topic. */
- X/*****************************************************************/
- X
- Xfor( n=0; n<FREQMAX; n++ )
- X {
- X nplus1 = n + 1;
- X FreqItem[n].NextItem = &FreqItem[nplus1];
- X FreqItem[n].LeftEdge = 38;
- X FreqItem[n].TopEdge = 9 * n;
- X FreqItem[n].Width = 88;
- X FreqItem[n].Height = 9;
- X FreqItem[n].Flags = ITEMTEXT | ITEMENABLED | HIGHCOMP | CHECKIT;
- X FreqItem[n].MutualExclude = (~(1 << n));
- X FreqItem[n].ItemFill = (APTR)&FreqText[n];
- X FreqItem[n].SelectFill = NULL;
- X FreqItem[n].Command = 0;
- X FreqItem[n].SubItem = NULL;
- X FreqItem[n].NextSelect = 0;
- X
- X FreqText[n].FrontPen = BLUP;
- X FreqText[n].BackPen = WHTP;
- X FreqText[n].DrawMode = JAM2; /* render in fore and background */
- X FreqText[n].LeftEdge = 0;
- X FreqText[n].TopEdge = 1;
- X FreqText[n].ITextFont = NULL;
- X FreqText[n].NextText = NULL;
- X }
- XFreqItem[FREQMAX-1].NextItem = NULL;
- X
- X/* select frequency item checked */
- Xswitch (p_rate) {
- X case 1: n = 0; break;
- X case 2: n = 1; break;
- X case 5: n = 2; break;
- X case 10: n = 3; break;
- X default: n = 1; p_rate = 2;
- X }
- XFreqItem[n].Flags |= CHECKED;
- X
- X/* initialize text for specific menu items */
- XFreqText[0].IText = (UBYTE *)" 1 Sec ";
- XFreqText[1].IText = (UBYTE *)" 2 Secs";
- XFreqText[2].IText = (UBYTE *)" 5 Secs";
- XFreqText[3].IText = (UBYTE *)" 10 Secs";
- X}
- X
- X/*****************************************************************/
- X/* The following initializes the structure arrays */
- X/* needed to provide the Priority menu topic. */
- X/*****************************************************************/
- X
- Xvoid InitPrioItems()
- X {
- X int n,nplus1;
- X
- X/* initialize each menu item and IntuiText with loop */
- Xfor( n=0; n<PRIOMAX; n++ )
- X {
- X nplus1 = n + 1;
- X PrioItem[n].NextItem = &PrioItem[nplus1];
- X PrioItem[n].LeftEdge = 0;
- X PrioItem[n].TopEdge = 9 * n;
- X PrioItem[n].Width = 80;
- X PrioItem[n].Height = 9;
- X PrioItem[n].Flags = ITEMTEXT | ITEMENABLED | HIGHCOMP | CHECKIT;
- X PrioItem[n].MutualExclude = (~(1 << n));
- X if (n < 3) PrioItem[n].MutualExclude &= 0x0007;
- X if (n < 1) PrioItem[n].MutualExclude |= 0x0007;
- X PrioItem[n].ItemFill = (APTR)&PrioText[n];
- X PrioItem[n].SelectFill = NULL;
- X PrioItem[n].Command = 0;
- X PrioItem[n].NextSelect = 0;
- X
- X PrioText[n].FrontPen = BLUP;
- X PrioText[n].BackPen = WHTP;
- X if (n > 11) {
- X PrioText[n].FrontPen = ORNP;
- X PrioText[n].BackPen = REDP;
- X }
- X PrioText[n].DrawMode = JAM2;
- X PrioText[n].LeftEdge = 0;
- X PrioText[n].TopEdge = 1;
- X PrioText[n].ITextFont = NULL;
- X PrioText[n].NextText = NULL;
- X }
- XPrioItem[PRIOMAX-1].NextItem = NULL;
- X
- X/* select priority item checked */
- Xswitch (p_priority) {
- X case -99: n = 3; break;
- X case -75: n = 4; break;
- X case -50: n = 5; break;
- X case -25: n = 6; break;
- X case -20: n = 7; break;
- X case -15: n = 8; break;
- X case -10: n = 9; break;
- X case -5: n = 10; break;
- X case 0: n = 11; break;
- X case 5: n = 12; break;
- X case 10: n = 13; break;
- X case 15: n = 14; break;
- X case 20: n = 15; break;
- X default: n = 11; p_priority = 0;
- X }
- XPrioItem[n].Flags |= CHECKED;
- X
- XPrioText[ 0].IText = (UBYTE *)" NORM ";
- XPrioText[ 1].IText = (UBYTE *)" DECR ";
- XPrioText[ 2].IText = (UBYTE *)" INCR ";
- XPrioText[ 3].IText = (UBYTE *)" -99 ";
- XPrioText[ 4].IText = (UBYTE *)" -75 ";
- XPrioText[ 5].IText = (UBYTE *)" -50 ";
- XPrioText[ 6].IText = (UBYTE *)" -25 ";
- XPrioText[ 7].IText = (UBYTE *)" -20 ";
- XPrioText[ 8].IText = (UBYTE *)" -15 ";
- XPrioText[ 9].IText = (UBYTE *)" -10 ";
- XPrioText[10].IText = (UBYTE *)" -5 ";
- XPrioText[11].IText = (UBYTE *)" 0 ";
- XPrioText[12].IText = (UBYTE *)" 5 ";
- XPrioText[13].IText = (UBYTE *)" 10 ";
- XPrioText[14].IText = (UBYTE *)" 15 ";
- XPrioText[15].IText = (UBYTE *)" 20 ";
- X}
- X
- X/*****************************************************************/
- X/* The following initializes the structure arrays */
- X/* needed to provide the Chip Mem Size menu topic. */
- X/*****************************************************************/
- X
- Xvoid InitChipItems()
- X {
- X int n,nplus1;
- X
- X/* initialize each menu item and IntuiText with loop */
- Xfor( n=0; n<CHIPMAX; n++ )
- X {
- X nplus1 = n + 1;
- X ChipItem[n].NextItem = &ChipItem[nplus1];
- X ChipItem[n].LeftEdge = 0;
- X ChipItem[n].TopEdge = 9 * n;
- X ChipItem[n].Width = 80;
- X ChipItem[n].Height = 9;
- X ChipItem[n].Flags = ITEMTEXT | ITEMENABLED | HIGHCOMP | CHECKIT;
- X ChipItem[n].MutualExclude = (~(1 << n));
- X ChipItem[n].ItemFill = (APTR)&ChipText[n];
- X ChipItem[n].SelectFill = NULL;
- X ChipItem[n].Command = 0;
- X ChipItem[n].NextSelect = 0;
- X
- X ChipText[n].FrontPen = BLUP;
- X ChipText[n].BackPen = WHTP;
- X ChipText[n].DrawMode = JAM2;
- X ChipText[n].LeftEdge = 0;
- X ChipText[n].TopEdge = 1;
- X ChipText[n].ITextFont = NULL;
- X ChipText[n].NextText = NULL;
- X }
- XChipItem[CHIPMAX-1].NextItem = NULL;
- X
- X/* select chip mem size item checked */
- Xswitch (p_chip) {
- X case 0: n = 0; break;
- X case 256: n = 1; break;
- X case 512: n = 2; break;
- X case 1024: n = 3; break;
- X case 2048: n = 4; break;
- X default: n = 2; p_chip = 512;
- X }
- XChipItem[n].Flags |= CHECKED;
- X
- XChipText[0].IText = (UBYTE *)" NONE";
- XChipText[1].IText = (UBYTE *)" 256K";
- XChipText[2].IText = (UBYTE *)" 512K";
- XChipText[3].IText = (UBYTE *)" 1 MB";
- XChipText[4].IText = (UBYTE *)" 2 MB";
- X}
- X
- X/*****************************************************************/
- X/* The following initializes the structure arrays */
- X/* needed to provide the Chip Base Addr menu topic. */
- X/*****************************************************************/
- X
- Xvoid InitChipAItems()
- X {
- X int n,nplus1;
- X
- X/* initialize each menu item and IntuiText with loop */
- Xfor( n=0; n<CHIPAMAX; n++ )
- X {
- X nplus1 = n + 1;
- X ChipAItem[n].NextItem = &ChipAItem[nplus1];
- X ChipAItem[n].LeftEdge = 0;
- X ChipAItem[n].TopEdge = 9 * n;
- X ChipAItem[n].Width = 80;
- X ChipAItem[n].Height = 9;
- X ChipAItem[n].Flags = ITEMTEXT | ITEMENABLED | HIGHCOMP | CHECKIT;
- X ChipAItem[n].MutualExclude = (~(1 << n));
- X ChipAItem[n].ItemFill = (APTR)&ChipAText[n];
- X ChipAItem[n].SelectFill = NULL;
- X ChipAItem[n].Command = 0;
- X ChipAItem[n].NextSelect = 0;
- X
- X ChipAText[n].FrontPen = BLUP;
- X ChipAText[n].BackPen = WHTP;
- X ChipAText[n].DrawMode = JAM2;
- X ChipAText[n].LeftEdge = 0;
- X ChipAText[n].TopEdge = 1;
- X ChipAText[n].ITextFont = NULL;
- X ChipAText[n].NextText = NULL;
- X }
- XChipAItem[CHIPAMAX-1].NextItem = NULL;
- X
- X/* select chip base address item checked */
- Xswitch (p_chipa) {
- X case 0: n = 0; break;
- X case 256: n = 1; break;
- X case 512: n = 2; break;
- X case 768: n = 3; break;
- X case 1024: n = 4; break;
- X case 1536: n = 5; break;
- X default: n = 0; p_chipa = 0;
- X }
- XChipAItem[n].Flags |= CHECKED;
- X
- XChipAText[0].IText = (UBYTE *)" @ 0K";
- XChipAText[1].IText = (UBYTE *)" @ 256K";
- XChipAText[2].IText = (UBYTE *)" @ 512K";
- XChipAText[3].IText = (UBYTE *)" @ 768K";
- XChipAText[4].IText = (UBYTE *)" @ 1.0M";
- XChipAText[5].IText = (UBYTE *)" @ 1.5M";
- X}
- X
- X/*****************************************************************/
- X/* The following initializes the structure arrays */
- X/* needed to provide the Slow Fast Mem Size menu topic. */
- X/*****************************************************************/
- X
- Xvoid InitSFItems()
- X {
- X int n,nplus1;
- X
- X/* initialize each menu item and IntuiText with loop */
- Xfor( n=0; n<SFMAX; n++ )
- X {
- X nplus1 = n + 1;
- X SFItem[n].NextItem = &SFItem[nplus1];
- X SFItem[n].LeftEdge = 0;
- X SFItem[n].TopEdge = 9 * n;
- X SFItem[n].Width = 80;
- X SFItem[n].Height = 9;
- X SFItem[n].Flags = ITEMTEXT | ITEMENABLED | HIGHCOMP | CHECKIT;
- X SFItem[n].MutualExclude = (~(1 << n));
- X SFItem[n].ItemFill = (APTR)&SFText[n];
- X SFItem[n].SelectFill = NULL;
- X SFItem[n].Command = 0;
- X SFItem[n].NextSelect = 0;
- X
- X SFText[n].FrontPen = BLUP;
- X SFText[n].BackPen = WHTP;
- X SFText[n].DrawMode = JAM2;
- X SFText[n].LeftEdge = 0;
- X SFText[n].TopEdge = 1;
- X SFText[n].ITextFont = NULL;
- X SFText[n].NextText = NULL;
- X }
- XSFItem[SFMAX-1].NextItem = NULL;
- X
- X/* select slow fast mem size item checked */
- Xswitch (p_sf) {
- X case 0: n = 0; break;
- X case 256: n = 1; break;
- X case 512: n = 2; break;
- X case 768: n = 3; break;
- X case 1024: n = 4; break;
- X case 1536: n = 5; break;
- X case 2048: n = 6; break;
- X case 3072: n = 7; break;
- X case 4096: n = 8; break;
- X case 6144: n = 9; break;
- X case 8192: n = 10; break;
- X default: n = 0; p_sf = 0;
- X }
- XSFItem[n].Flags |= CHECKED;
- X
- XSFText[ 0].IText = (UBYTE *)" NONE ";
- XSFText[ 1].IText = (UBYTE *)" .25 MB";
- XSFText[ 2].IText = (UBYTE *)" .5 MB";
- XSFText[ 3].IText = (UBYTE *)" .75 MB";
- XSFText[ 4].IText = (UBYTE *)" 1.0 MB";
- XSFText[ 5].IText = (UBYTE *)" 1.5 MB";
- XSFText[ 6].IText = (UBYTE *)" 2.0 MB";
- XSFText[ 7].IText = (UBYTE *)" 3.0 MB";
- XSFText[ 8].IText = (UBYTE *)" 4.0 MB";
- XSFText[ 9].IText = (UBYTE *)" 6.0 MB";
- XSFText[10].IText = (UBYTE *)" 8.0 MB";
- X}
- X
- X/*****************************************************************/
- X/* The following initializes the structure arrays */
- X/* needed to provide the Slow Fast Mem Base Addr menu topic. */
- X/*****************************************************************/
- X
- Xvoid InitSFAItems()
- X {
- X int n,nplus1;
- X
- X/* initialize each menu item and IntuiText with loop */
- Xfor( n=0; n<SFAMAX; n++ )
- X {
- X nplus1 = n + 1;
- X SFAItem[n].NextItem = &SFAItem[nplus1];
- X SFAItem[n].LeftEdge = 0;
- X SFAItem[n].TopEdge = 9 * n;
- X SFAItem[n].Width = 104;
- X SFAItem[n].Height = 9;
- X SFAItem[n].Flags = ITEMTEXT | ITEMENABLED | HIGHCOMP | CHECKIT;
- X SFAItem[n].MutualExclude = (~(1 << n));
- X SFAItem[n].ItemFill = (APTR)&SFAText[n];
- X SFAItem[n].SelectFill = NULL;
- X SFAItem[n].Command = 0;
- X SFAItem[n].NextSelect = 0;
- X
- X SFAText[n].FrontPen = BLUP;
- X SFAText[n].BackPen = WHTP;
- X SFAText[n].DrawMode = JAM2;
- X SFAText[n].LeftEdge = 0;
- X SFAText[n].TopEdge = 1;
- X SFAText[n].ITextFont = NULL;
- X SFAText[n].NextText = NULL;
- X }
- XSFAItem[SFAMAX-1].NextItem = NULL;
- X
- X/* select slow fast mem base address item checked */
- Xswitch (p_sfa) {
- X case 2048: n = 0; break; /* 0x0800 kb = 2 mb */
- X case 2304: n = 1; break; /* 0x0900 kb = 2.25 mb */
- X case 2560: n = 2; break; /* 0x0A00 kb = 2.5 mb */
- X case 2816: n = 3; break; /* 0x0B00 kb = 2.75 mb */
- X case 3072: n = 4; break; /* 0x0C00 kb = 3 mb */
- X case 4096: n = 5; break; /* 0x1000 kb = 4 mb */
- X case 5120: n = 6; break; /* 0x1400 kb = 5 mb */
- X case 6144: n = 7; break; /* 0x1800 kb = 6 mb */
- X case 7168: n = 8; break; /* 0x1C00 kb = 7 mb */
- X case 8192: n = 9; break; /* 0x2000 kb = 8 mb */
- X case 9216: n = 10; break; /* 0x2400 kb = 9 mb */
- X case 12288: n = 11; break; /* 0x3000 kb = 12 mb */
- X case 12544: n = 12; break; /* 0x3100 kb = 12.25 mb */
- X case 12800: n = 13; break; /* 0x3200 kb = 12.5 mb */
- X case 13056: n = 14; break; /* 0x3300 kb = 12.75 mb */
- X case 13312: n = 15; break; /* 0x3400 kb = 13 mb */
- X default: n = 0; p_sfa = 2048;
- X }
- XSFAItem[n].Flags |= CHECKED;
- X
- XSFAText[ 0].IText = (UBYTE *)" @ 2.0 Meg";
- XSFAText[ 1].IText = (UBYTE *)" @ 2.4 Meg";
- XSFAText[ 2].IText = (UBYTE *)" @ 2.8 Meg";
- XSFAText[ 3].IText = (UBYTE *)" @ 2.C Meg";
- XSFAText[ 4].IText = (UBYTE *)" @ 3.0 Meg";
- XSFAText[ 5].IText = (UBYTE *)" @ 4.0 Meg";
- XSFAText[ 6].IText = (UBYTE *)" @ 5.0 Meg";
- XSFAText[ 7].IText = (UBYTE *)" @ 6.0 Meg";
- XSFAText[ 8].IText = (UBYTE *)" @ 7.0 Meg";
- XSFAText[ 9].IText = (UBYTE *)" @ 8.0 Meg";
- XSFAText[10].IText = (UBYTE *)" @ 9.0 Meg";
- XSFAText[11].IText = (UBYTE *)" @ C.0 Meg";
- XSFAText[12].IText = (UBYTE *)" @ C.4 Meg";
- XSFAText[13].IText = (UBYTE *)" @ C.8 Meg";
- XSFAText[14].IText = (UBYTE *)" @ C.C Meg";
- XSFAText[15].IText = (UBYTE *)" @ D.0 Meg";
- X}
- X
- X/*****************************************************************/
- X/* The following initializes the structure arrays */
- X/* needed to provide the Fast Mem Size menu topic. */
- X/*****************************************************************/
- X
- Xvoid InitFastItems()
- X {
- X int n,nplus1;
- X
- X/* initialize each menu item and IntuiText with loop */
- Xfor( n=0; n<FASTMAX; n++ )
- X {
- X nplus1 = n + 1;
- X FastItem[n].NextItem = &FastItem[nplus1];
- X FastItem[n].LeftEdge = 0;
- X FastItem[n].TopEdge = 9 * n;
- X FastItem[n].Width = 80;
- X FastItem[n].Height = 9;
- X FastItem[n].Flags = ITEMTEXT | ITEMENABLED | HIGHCOMP | CHECKIT;
- X FastItem[n].MutualExclude = (~(1 << n));
- X FastItem[n].ItemFill = (APTR)&FastText[n];
- X FastItem[n].SelectFill = NULL;
- X FastItem[n].Command = 0;
- X FastItem[n].NextSelect = 0;
- X
- X FastText[n].FrontPen = BLUP;
- X FastText[n].BackPen = WHTP;
- X FastText[n].DrawMode = JAM2;
- X FastText[n].LeftEdge = 0;
- X FastText[n].TopEdge = 1;
- X FastText[n].ITextFont = NULL;
- X FastText[n].NextText = NULL;
- X }
- XFastItem[FASTMAX-1].NextItem = NULL;
- X
- X/* select fast mem size item checked */
- Xswitch (p_fast) {
- X case 0: n = 0; break;
- X case 256: n = 1; break;
- X case 512: n = 2; break;
- X case 756: n = 3; break;
- X case 1: n = 4; break;
- X case 2: n = 5; break;
- X case 3: n = 6; break;
- X case 4: n = 7; break;
- X case 6: n = 8; break;
- X case 8: n = 9; break;
- X case 10: n = 10; break;
- X case 12: n = 11; break;
- X case 13: n = 12; break;
- X case 14: n = 13; break;
- X case 15: n = 14; break;
- X case 16: n = 15; break;
- X default: n = 0; p_fast = 0;
- X }
- XFastItem[n].Flags |= CHECKED;
- X
- XFastText[ 0].IText = (UBYTE *)" NONE";
- XFastText[ 1].IText = (UBYTE *)" 256K";
- XFastText[ 2].IText = (UBYTE *)" 512K";
- XFastText[ 3].IText = (UBYTE *)" 756K";
- XFastText[ 4].IText = (UBYTE *)" 1 MB";
- XFastText[ 5].IText = (UBYTE *)" 2 MB";
- XFastText[ 6].IText = (UBYTE *)" 3 MB";
- XFastText[ 7].IText = (UBYTE *)" 4 MB";
- XFastText[ 8].IText = (UBYTE *)" 6 MB";
- XFastText[ 9].IText = (UBYTE *)" 8 MB";
- XFastText[10].IText = (UBYTE *)" 10 MB";
- XFastText[11].IText = (UBYTE *)" 12 MB";
- XFastText[12].IText = (UBYTE *)" 13 MB";
- XFastText[13].IText = (UBYTE *)" 14 MB";
- XFastText[14].IText = (UBYTE *)" 15 MB";
- XFastText[15].IText = (UBYTE *)" 16 MB";
- X}
- X
- X/*****************************************************************/
- X/* The following initializes the structure arrays */
- X/* needed to provide the Fast Mem Base Addr menu topic. */
- X/*****************************************************************/
- X
- Xvoid InitFastAItems()
- X {
- X int n,nplus1;
- X
- X/* initialize each menu item and IntuiText with loop */
- Xfor( n=0; n<FASTAMAX; n++ )
- X {
- X nplus1 = n + 1;
- X FastAItem[n].NextItem = &FastAItem[nplus1];
- X FastAItem[n].LeftEdge = 0;
- X FastAItem[n].TopEdge = 9 * n;
- X FastAItem[n].Width = 80;
- X FastAItem[n].Height = 9;
- X FastAItem[n].Flags = ITEMTEXT | ITEMENABLED | HIGHCOMP | CHECKIT;
- X FastAItem[n].MutualExclude = (~(1 << n));
- X FastAItem[n].ItemFill = (APTR)&FastAText[n];
- X FastAItem[n].SelectFill = NULL;
- X FastAItem[n].Command = 0;
- X FastAItem[n].NextSelect = 0;
- X
- X FastAText[n].FrontPen = BLUP;
- X FastAText[n].BackPen = WHTP;
- X FastAText[n].DrawMode = JAM2;
- X FastAText[n].LeftEdge = 0;
- X FastAText[n].TopEdge = 1;
- X FastAText[n].ITextFont = NULL;
- X FastAText[n].NextText = NULL;
- X }
- XFastAItem[FASTAMAX-1].NextItem = NULL;
- X
- X/* select fast base address item checked */
- Xswitch (p_fasta) {
- X case 2: n = 0; break; /* Offset in megs above 0x0000000 */
- X case 3: n = 1; break;
- X case 4: n = 2; break;
- X case 5: n = 3; break;
- X case 6: n = 4; break;
- X case 8: n = 5; break;
- X case -1: n = 6; break;
- X case -2: n = 7; break;
- X case -3: n = 8; break; /* Offset in megs below 0x8000000 */
- X case -4: n = 9; break;
- X case -6: n = 10; break;
- X case -8: n = 11; break;
- X case -10: n = 12; break;
- X case -12: n = 13; break;
- X case -14: n = 14; break;
- X case -16: n = 15; break;
- X default: n = 6; p_fasta = -1;
- X }
- XFastAItem[n].Flags |= CHECKED;
- X
- XFastAText[ 0].IText = (UBYTE *)" @ 2 M";
- XFastAText[ 1].IText = (UBYTE *)" @ 3 M";
- XFastAText[ 2].IText = (UBYTE *)" @ 4 M";
- XFastAText[ 3].IText = (UBYTE *)" @ 5 M";
- XFastAText[ 4].IText = (UBYTE *)" @ 6 M";
- XFastAText[ 5].IText = (UBYTE *)" @ 8 M";
- XFastAText[ 6].IText = (UBYTE *)" @7f M";
- XFastAText[ 7].IText = (UBYTE *)" @7e M";
- XFastAText[ 8].IText = (UBYTE *)" @7d M";
- XFastAText[ 9].IText = (UBYTE *)" @7c M";
- XFastAText[10].IText = (UBYTE *)" @7a M";
- XFastAText[11].IText = (UBYTE *)" @78 M";
- XFastAText[12].IText = (UBYTE *)" @76 M";
- XFastAText[13].IText = (UBYTE *)" @74 M";
- XFastAText[14].IText = (UBYTE *)" @72 M";
- XFastAText[15].IText = (UBYTE *)" @70 M";
- X}
- X
- X/****************************************************************/
- X/* The following function inits the Menu structure array with */
- X/* appropriate values for our simple menu. Review the manual */
- X/* if you need to know what each value means. */
- X/****************************************************************/
- Xvoid InitMenu()
- X{
- Xmenu[0].NextMenu = &menu[1];
- Xmenu[0].LeftEdge = 0;
- Xmenu[0].TopEdge = 0;
- Xmenu[0].Width = 64;
- Xmenu[0].Height = 10;
- Xmenu[0].Flags = MENUENABLED;
- Xmenu[0].MenuName = "Project"; /* text for menu-bar display */
- Xmenu[0].FirstItem = &ProjItem[0]; /* pointer to first item in list */
- X
- Xmenu[1].NextMenu = &menu[2];
- Xmenu[1].LeftEdge = 64;
- Xmenu[1].TopEdge = 0;
- Xmenu[1].Width = 48;
- Xmenu[1].Height = 10;
- Xmenu[1].Flags = MENUENABLED;
- Xmenu[1].MenuName = "Setup"; /* text for menu-bar display */
- Xmenu[1].FirstItem = &SetupItem[0]; /* pointer to first item in list */
- X
- Xmenu[2].NextMenu = &menu[3];
- Xmenu[2].LeftEdge = 112;
- Xmenu[2].TopEdge = 0;
- Xmenu[2].Width = 72;
- Xmenu[2].Height = 10;
- Xmenu[2].Flags = MENUENABLED;
- Xmenu[2].MenuName = "Priority"; /* text for menu-bar display */
- Xmenu[2].FirstItem = &PrioItem[0]; /* pointer to first item in list */
- X
- Xmenu[3].NextMenu = &menu[4];
- Xmenu[3].LeftEdge = 184;
- Xmenu[3].TopEdge = 0;
- Xmenu[3].Width = 80;
- Xmenu[3].Height = 10;
- Xmenu[3].Flags = MENUENABLED;
- Xmenu[3].MenuName = "Chip Size"; /* text for menu-bar display */
- Xmenu[3].FirstItem = &ChipItem[0]; /* pointer to first item in list */
- X
- Xmenu[4].NextMenu = &menu[5];
- Xmenu[4].LeftEdge = 264;
- Xmenu[4].TopEdge = 0;
- Xmenu[4].Width = 80;
- Xmenu[4].Height = 10;
- Xmenu[4].Flags = MENUENABLED;
- Xmenu[4].MenuName = "Chip Addr"; /* text for menu-bar display */
- Xmenu[4].FirstItem = &ChipAItem[0]; /* pointer to first item in list */
- X
- Xmenu[5].NextMenu = &menu[6];
- Xmenu[5].LeftEdge = 344;
- Xmenu[5].TopEdge = 0;
- Xmenu[5].Width = 64;
- Xmenu[5].Height = 10;
- Xmenu[5].Flags = MENUENABLED;
- Xmenu[5].MenuName = "SF Size"; /* text for menu-bar display */
- Xmenu[5].FirstItem = &SFItem[0]; /* pointer to first item in list */
- X
- Xmenu[6].NextMenu = &menu[7];
- Xmenu[6].LeftEdge = 408;
- Xmenu[6].TopEdge = 0;
- Xmenu[6].Width = 64;
- Xmenu[6].Height = 10;
- Xmenu[6].Flags = MENUENABLED;
- Xmenu[6].MenuName = "SF Addr"; /* text for menu-bar display */
- Xmenu[6].FirstItem = &SFAItem[0]; /* pointer to first item in list */
- X
- Xmenu[7].NextMenu = &menu[8];
- Xmenu[7].LeftEdge = 472;
- Xmenu[7].TopEdge = 0;
- Xmenu[7].Width = 80;
- Xmenu[7].Height = 10;
- Xmenu[7].Flags = MENUENABLED;
- Xmenu[7].MenuName = "Fast Size"; /* text for menu-bar display */
- Xmenu[7].FirstItem = &FastItem[0]; /* pointer to first item in list */
- X
- Xmenu[8].NextMenu = NULL;
- Xmenu[8].LeftEdge = 552;
- Xmenu[8].TopEdge = 0;
- Xmenu[8].Width = 80;
- Xmenu[8].Height = 10;
- Xmenu[8].Flags = MENUENABLED;
- Xmenu[8].MenuName = "Fast Addr"; /* text for menu-bar display */
- Xmenu[8].FirstItem = &FastAItem[0]; /* pointer to first item in list */
- X
- X}
- X
- Xvoid StartMenus()
- X{
- XSetMenuStrip(window,&menu[0]);
- X}
- END_OF_FILE
- if test 27558 -ne `wc -c <'mminit.c'`; then
- echo shar: \"'mminit.c'\" unpacked with wrong size!
- fi
- # end of 'mminit.c'
- fi
- echo shar: End of archive 2 \(of 2\).
- cp /dev/null ark2isdone
- MISSING=""
- for I in 1 2 ; do
- if test ! -f ark${I}isdone ; then
- MISSING="${MISSING} ${I}"
- fi
- done
- if test "${MISSING}" = "" ; then
- echo You have unpacked both archives.
- rm -f ark[1-9]isdone
- else
- echo You still need to unpack the following archives:
- echo " " ${MISSING}
- fi
- ## End of shell archive.
- exit 0
- --
- Mail submissions (sources or binaries) to <amiga@uunet.uu.net>.
- Mail comments to the moderator at <amiga-request@uunet.uu.net>.
- Post requests for sources, and general discussion to comp.sys.amiga.misc.
-